home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / DevCon / Milan_1991 / Devcon91.1 / Libraries / Commodities / IHelp / app.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-01  |  7.8 KB  |  185 lines

  1.  
  2.    /***********************************************************************
  3.    *                                                                      *
  4.    *                            COPYRIGHTS                                *
  5.    *                                                                      *
  6.    *   Copyright (c) 1990  Commodore-Amiga, Inc.  All Rights Reserved.    *
  7.    *                                                                      *
  8.    ***********************************************************************/
  9.  
  10. #ifndef APP_H
  11. #define APP_H
  12.  
  13. #ifdef LATTICE
  14. #include <pragmas/gadtools_pragmas.h>
  15. #endif
  16.  
  17. #include <clib/all_protos.h>
  18.  
  19. /**********************************************************************/
  20. /* Prototypes for functions declared in app.c and called from the  */
  21. /* standard modules.                                                  */
  22. /**********************************************************************/
  23. VOID setupCustomGadgets(struct Gadget **);
  24. VOID HandleGadget(ULONG,ULONG);
  25. VOID setupCustomMenu(VOID);
  26. VOID handleCustomMenu(UWORD);
  27. VOID refreshWindow(VOID);
  28. BOOL setupCustomCX(VOID);
  29. VOID shutdownCustomCX(VOID);
  30. VOID handleCustomCXMsg(ULONG);
  31. VOID handleCustomCXCommand(ULONG);
  32. VOID handleCustomSignal(VOID);
  33.  
  34. /**********************************************************************/
  35. /* Prototypes for functions declared in the standard modules and      */
  36. /* called by app.c                                                    */
  37. /**********************************************************************/
  38. VOID setupWindow(VOID);
  39. VOID shutdownWindow(VOID);
  40. VOID terminate(VOID);
  41.  
  42. /**********************************************************************/
  43. /* Prototypes for functions declared in application modules and       */
  44. /* called by app.c                                                    */
  45. /**********************************************************************/
  46. BOOL setupIHelp(VOID);
  47. VOID MyHandleCXMsg(ULONG);
  48.  
  49. /**********************************************************************/
  50. /* definitions for global variables declared in the standard modules  */
  51. /* referenced by app.c                                                */
  52. /**********************************************************************/
  53. extern CxObj                  *broker;
  54. extern SHORT                  topborder;
  55. extern VOID                   *vi;
  56. extern struct Menu            *menu;
  57. extern struct Library         *GadToolsBase;
  58. extern struct Gadget          *glist;
  59. extern char                   **ttypes;
  60. extern struct MsgPort         *cxport;
  61. extern struct IntuitionBase   *IntuitionBase;
  62. extern struct DrawInfo        *mydi;
  63. extern BOOL                   IDCMPRefresh;
  64.  
  65. /**********************************************************************/
  66. /* definitions for global variables declared in app.c and             */
  67. /* referenced by the standard modules.                                */
  68. /**********************************************************************/
  69. extern struct TextAttr mydesiredfont;
  70.  
  71. /**********************************************************************/
  72. /* Commodities specific definitions.                                  */
  73. /*                                                                    */
  74. /* COM_NAME  - used for the scrolling display in the Exchange program */
  75. /* COM_TITLE - used for the window title bar and the long description */
  76. /*             in the Exchange program                                */
  77. /* COM_DESC  - Commodity description used by the Exchange program     */
  78. /* CX_DEFAULT_PRIORITY - default priority for this commodities broker */
  79. /*                       can be overidden by using icon TOOL TYPES    */
  80. /**********************************************************************/
  81. #define COM_NAME  "ihelp"
  82. #define COM_TITLE "Intuition Helper"
  83. #define COM_DESCR "Custom Intuition Functions"
  84. #define CX_DEFAULT_PRIORITY 0
  85. #define CX_DEFAULT_POP_KEY ("shift f1")
  86. #define CX_DEFAULT_POP_ON_START ("YES")
  87.  
  88. /**********************************************************************/
  89. /* Custom Signal control                                              */
  90. /*                                                                    */
  91. /* If CSIGNAL = 0 then this commodity will NOT have a custom signal   */
  92. /* If CSIGNAL = 1 this commodity will support a custom signal         */
  93. /**********************************************************************/
  94. #define CSIGNAL 0
  95.  
  96. /**********************************************************************/
  97. /* Window control                                                     */
  98. /*                                                                    */
  99. /* If WINDOW = 0 then this commodity will NOT have a popup window     */
  100. /* If WINDOW = 1 this commodity will support a popup window with the  */
  101. /*               attributes defined below.                            */
  102. /**********************************************************************/
  103. #define WINDOW 0
  104.  
  105. #if WINDOW
  106. #define W(x) x
  107. #else
  108. #define W(x) ;
  109. #endif
  110.  
  111. #if WINDOW
  112.  
  113. extern struct Window   *window; /* our window */
  114. extern struct TextFont *font;
  115.  
  116. #define WINDOW_LEFT   134
  117. #define WINDOW_TOP    64
  118. #define WINDOW_WIDTH  362
  119. #define WINDOW_HEIGHT 68
  120. #define WINDOW_INNERHEIGHT 70
  121.  
  122. #define WINDOW_SIZING 0
  123. #if WINDOW_SIZING
  124. #define WINDOW_MAX_WIDTH  -1
  125. #define WINDOW_MIN_WIDTH  50
  126. #define WINDOW_MAX_HEIGHT -1
  127. #define WINDOW_MIN_HEIGHT 30
  128. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWSIZING | WINDOWDEPTH | SIMPLE_REFRESH )
  129. #else
  130. #define WINDOW_MAX_WIDTH  WINDOW_WIDTH
  131. #define WINDOW_MIN_WIDTH  WINDOW_WIDTH
  132. #define WINDOW_MAX_HEIGHT WINDOW_HEIGHT
  133. #define WINDOW_MIN_HEIGHT WINDOW_HEIGHT
  134. #define WFLAGS (ACTIVATE | WINDOWCLOSE | WINDOWDRAG | WINDOWDEPTH | SIMPLE_REFRESH )
  135. #endif  /* WINDOW_SIZING */
  136.  
  137. #define IFLAGS (MENUPICK | MOUSEBUTTONS | GADGETUP | GADGETDOWN | MOUSEMOVE | CLOSEWINDOW | REFRESHWINDOW )
  138.  
  139.                                      /* hotkey definitions                */
  140. #define POP_KEY_ID     (86L)         /* pop up identifier                 */
  141.  
  142. /**********************************************************************/
  143. /* Gadget control                                                     */
  144. /*                                                                    */
  145. /* Here are the gadget specific definitions. Note that these are      */
  146. /* included only if WINDOW=1 since gadgets make no sense without a    */
  147. /* window.                                                            */
  148. /**********************************************************************/
  149. #define GAD_HIDE     1
  150. #define GAD_DIE      2
  151.  
  152. /**********************************************************************/
  153. /* Menu control                                                       */
  154. /*                                                                    */
  155. /* Here are the menu specific definitions. Note that these are        */
  156. /* included only if WINDOW=1 since menus make no sense without a      */
  157. /* window.                                                            */
  158. /**********************************************************************/
  159. #define MENU_HIDE     1
  160. #define MENU_DIE      2
  161.  
  162. #endif  /* WINDOW */
  163.  
  164. /**********************************************************************/
  165. /* Debug control                                                      */
  166. /*                                                                    */
  167. /* The first define converts any printfs that got in by mistake into  */
  168. /* kprintfs. If you are debuging to the console you can change        */
  169. /* kprintfs into printfs.                                             */
  170. /* The D1(x) define controls debugging in the standard modules. Use   */
  171. /* The D(x) macro for debugging in the app.c module.                  */
  172. /**********************************************************************/
  173. void kprintf(char *,...);
  174. #define printf kprintf
  175.  
  176. #ifdef DEBUG
  177. #define D1(x) x
  178. #define D(x)  x
  179. #else
  180. #define D1(x) ;
  181. #define D(x)  ;
  182. #endif /* NO DEBUG */
  183.  
  184. #endif /* APP_H */
  185.